﻿using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using System.Threading;

namespace Simple2DSample
{

    public class FSM
    {

        public FSM()
        {
            
        }

        public IEnumerator m_ProcessEnum;
        
        //차후배열로도 가능?

        public ICondition m_Condition;

    }


    public interface ICondition
    {

        bool IsComplete();
        void Cancel();

    }


    
    public class ThreadJob : ICondition
    {

        public delegate int Job();
        public int ret = -1;


        Job _job;

        public ThreadJob(Job job)
        {
            _job = job;

            MyThreadPool.I.AddJob(this);
        }

        public void Run()
        {
            ret = _job();
        }

        public bool IsComplete()
        {
            if (ret == -1)
                return false;
            return true;
        }
        public void Cancel() { }
    }



}
